<!per $_GET['askid'] paduodamas ask lenteles indeksas, pagal tai dedamas feedbakas>
<?php
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//ciuju is sesijos reik pasiimt curent user id
$userid = $_SESSION['uid'];
require_once ("classes/work.class.php");
require_once ("classes/ask.class.php");
require_once ("classes/feedback.class.php");
require_once ("classes/user.class.php");
require_once ("classes/category.class.php");
$ask = new Ask($_GET['askid']);
$work = new Work($ask->getWorkId());
$cat = new Category($work->getCategoryId());
$user = new User($work->getUserId());
echo "<h3>Rate ".$user->getName()."</h3>";
?>
<blockquote>
    <p><?php echo $work->getDescription(); ?></p>
    <small>Category: <?php echo $cat->getName(); ?></small>
</blockquote>
<script type="text/javascript">
    $(function() {
        var austDay = new Date();
<?php
$datep = date("Y-m-d", strtotime(date("Y-m-d", strtotime(date("Y-m-d", strtotime($work->getDate())))) . " +2 week"));
$time = explode(" ", $datep);
$date = explode("-", $time[0]);
?>
                        
                   
                                austDay = new Date(<?php echo $date[0]; ?>,<?php echo $date[1] - 1; ?>,<?php echo $date[2]; ?>,0,0,0);
                                $('.defaultCountdown').countdown({until: austDay});
                                $('#year').text(austDay.getFullYear());
                            });
                            $('#click_uid<?php echo $aid; ?>').click(function() {
                                var bool = 0;
                                $('#uid<?php echo $aid; ?>').toggle();
                            });
</script>
<div class="defaultCountdown" style="margin:0 0 5px 0;"></div>


<form method="post" action="index.php?p=fsent">
    <input type="hidden" name="form_token" value="<?php echo $form_token; ?>" />
    <fieldset>
        <div class="clearfix">
            <label for="speed">Speed/On Time</label>
            <div class="input">
                <select name="speed">
                    <option value="1" name="">1</option>
                    <option value="2" name="">2</option>
                    <option value="3" name="">3</option>
                    <option value="4" name="">4</option>
                    <option value="5" name="">5</option>
                </select>
            </div>
        </div>
        <input type="hidden" name="askid" value="<?php echo $_GET['askid']; ?>" />
        <div class="clearfix">
            <label for="quality">Quality</label>
            <div class="input">

                <select name="quality">
                    <option value="1" name="">1</option>
                    <option value="2" name="">2</option>
                    <option value="3" name="">3</option>
                    <option value="4" name="">4</option>
                    <option value="5" name="">5</option>
                </select>
            </div>
        </div>
        <div class="clearfix">
            <label for="quality">Comment</label>
            <div class="input">
                <textarea name="comment" placeholder="Comment"></textarea>
            </div>
        </div>
        <div class="actions">
            <input class="btn primary" type="submit" name="ok" value="Give Feedback"/>
        </div>
    </fieldset>
</form>